using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Microsoft.Practices.Unity.Interception
{
    [TestClass]
    public class ErrorsVirtualInterceptorTest
    {
        [TestMethod]
        public void CannotInterceptNonPublicClass()
        {
            AssertEx.Throws<TypeLoadException>(
                () => VirtualInterceptor.WrapClass(typeof(PrivateClass)));
        }

        [TestMethod]
        public void CannotInterceptSealedClass()
        {
            AssertEx.Throws<TypeLoadException>(
                () => VirtualInterceptor.WrapClass(typeof(SealedClass)));
        }

        public sealed class SealedClass { }

        class PrivateClass { }
    }
}